package com.xiaoniu.lib_keleim.db.manager;

import android.util.Log;

import io.realm.DynamicRealm;
import io.realm.RealmMigration;

public class MyMigration implements RealmMigration {

    /**
     * 本地数据库升级的时候会自动回调一次
     *
     * @param realm
     * @param oldVersion
     * @param newVersion
     */
    @Override
    public void migrate(DynamicRealm realm, long oldVersion, long newVersion) {
        Log.i("Realm", oldVersion + "-----" + newVersion);
//        RealmSchema schema = realm.getSchema();

        if (oldVersion == 1 && newVersion == 2) {
//            schema.get("VideoDownloadBean")
//                    .addField("updateValue1", String.class)
//                    .addField("updateValue2", String.class);
            oldVersion++;

        }
    }
}